package com.dotflat.training.repository;

import com.dotflat.training.domain.OTCourseBookRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OTCourseBookRecordRepository extends JpaRepository<OTCourseBookRecord, String>, JpaSpecificationExecutor<OTCourseBookRecord> {


    List<OTCourseBookRecord> findAllByAreaIdAndStaffIdAndOfflineCourseIdInAndDeletedIsFalse(String areaId, String staffId, List<String> courseIds);

    OTCourseBookRecord findFirstByAreaIdAndStaffIdAndOfflineCourseIdAndDeletedIsFalse(String areaId, String staffId, String courseId);

}
